<?php 
$rootpath=$CONFIG['dir_path'];
 $File = "../".".htaccess"; 
 $Handle = fopen($File, 'w');
 $Data = "RewriteEngine on 
RewriteBase ".$rootpath."
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d  
RewriteRule ^trang-chu/$ index.php?page=home
RewriteRule ^lien-he/$ index.php?page=contact
"; 
 $ok=fwrite($Handle, $Data); 
 if($ok)
 print "Data Written"; 
 else print "loi";
 fclose($Handle); 
 ?>